/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * Frequency_dampingratio_estimation_and_plot1219.c
 *
 * Code generation for function 'Frequency_dampingratio_estimation_and_plot1219'
 *
 */

/* Include files */
#include "Frequency_dampingratio_estimation_and_plot1219.h"
#include "FFTImplementationCallback.h"
#include "emxutil.h"
#include "types.h"
#include "findpeaks.h"
#include "rt_nonfinite.h"
#include "rt_nonfinite.h"
#include <math.h>
#include <string.h>

/* Function Declarations */
static void find_crossing_points(const double P[1025], double y_line,
                                 double cross_freq_data[],
                                 int cross_freq_size[2]);

static double rt_hypotd_snf(double u0, double u1);

static double rt_powd_snf(double u0, double u1);

/* Function Definitions */
static void find_crossing_points(const double P[1025], double y_line,
                                 double cross_freq_data[],
                                 int cross_freq_size[2])
{
  double cross_freq[1000];
  int count;
  int i;
  /*  查找频谱与水平线的交点 */
  memset(&cross_freq[0], 0, 1000U * sizeof(double));
  count = -1;
  for (i = 0; i < 1024; i++) {
    double d;
    double d1;
    d = P[i + 1];
    d1 = P[i];
    if ((d1 - y_line) * (d - y_line) < 0.0) {
      double cross_freq_tmp;
      /*  线性插值找到交点 */
      count++;
      cross_freq_tmp = 0.048828125 * (double)i;
      cross_freq[count] =
          cross_freq_tmp +
          (y_line - d1) * (0.048828125 * ((double)i + 1.0) - cross_freq_tmp) /
              (d - d1);
    }
  }
  if (count + 1 < 1) {
    count = -1;
  }
  cross_freq_size[0] = 1;
  cross_freq_size[1] = count + 1;
  if (count >= 0) {
    memcpy(&cross_freq_data[0], &cross_freq[0],
           (unsigned int)(count + 1) * sizeof(double));
  }
}

static double rt_hypotd_snf(double u0, double u1)
{
  double a;
  double b;
  double y;
  a = fabs(u0);
  b = fabs(u1);
  if (a < b) {
    a /= b;
    y = b * sqrt(a * a + 1.0);
  } else if (a > b) {
    b /= a;
    y = a * sqrt(b * b + 1.0);
  } else if (rtIsNaN(b)) {
    y = rtNaN;
  } else {
    y = a * 1.4142135623730951;
  }
  return y;
}

static double rt_powd_snf(double u0, double u1)
{
  double y;
  if (rtIsNaN(u0) || rtIsNaN(u1)) {
    y = rtNaN;
  } else {
    double d;
    double d1;
    d = fabs(u0);
    d1 = fabs(u1);
    if (rtIsInf(u1)) {
      if (d == 1.0) {
        y = 1.0;
      } else if (d > 1.0) {
        if (u1 > 0.0) {
          y = rtInf;
        } else {
          y = 0.0;
        }
      } else if (u1 > 0.0) {
        y = 0.0;
      } else {
        y = rtInf;
      }
    } else if (d1 == 0.0) {
      y = 1.0;
    } else if (d1 == 1.0) {
      if (u1 > 0.0) {
        y = u0;
      } else {
        y = 1.0 / u0;
      }
    } else if (u1 == 2.0) {
      y = u0 * u0;
    } else if ((u1 == 0.5) && (u0 >= 0.0)) {
      y = sqrt(u0);
    } else if ((u0 < 0.0) && (u1 > floor(u1))) {
      y = rtNaN;
    } else {
      y = pow(u0, u1);
    }
  }
  return y;
}

void Frequency_dampingratio_estimation_and_plot1219(
    double a[60000], double t0, double t1, double H, char stru_material,
    double frequency[3], double original_frequency[3], double dampingratio[3],
    double original_dampingratio[3], double f[1025], double P[1025])
{
  static const double window[2048] = {0.0,
                                      2.3553948388377322E-6,
                                      9.421557163713512E-6,
                                      2.11984204002702E-5,
                                      3.768587359187503E-5,
                                      5.8883761400674306E-5,
                                      8.4791884109036708E-5,
                                      0.0001154099976216072,
                                      0.00015073781346730541,
                                      0.0001907749988023788,
                                      0.00023552117641323367,
                                      0.00028497592472032096,
                                      0.0003391387777817445,
                                      0.00039800922529786842,
                                      0.00046158671261609108,
                                      0.00052987064073617418,
                                      0.00060286036631551632,
                                      0.00068055520167575878,
                                      0.00076295441480872528,
                                      0.0008500572293838049,
                                      0.000941862824754891,
                                      0.0010383703359682084,
                                      0.0011395788537706397,
                                      0.001245487424618108,
                                      0.0013560950506845693,
                                      0.0014714006898715604,
                                      0.0015914032558177471,
                                      0.0017161016179095823,
                                      0.0018454946012914086,
                                      0.0019795809868770609,
                                      0.0021183595113609677,
                                      0.0022618288672302533,
                                      0.0024099877027770056,
                                      0.0025628346221109877,
                                      0.00272036818517285,
                                      0.0028825869077476196,
                                      0.0030494892614786884,
                                      0.003221073673882302,
                                      0.0033973385283623259,
                                      0.0035782821642254548,
                                      0.0037639028766968119,
                                      0.0039541989169362135,
                                      0.0041491684920543226,
                                      0.0043488097651298019,
                                      0.0045531208552266889,
                                      0.0047620998374117152,
                                      0.0049757447427728474,
                                      0.0051940535584376613,
                                      0.0054170242275922709,
                                      0.00564465464950098,
                                      0.0058769426795255431,
                                      0.0061138861291458735,
                                      0.00635548276598058,
                                      0.0066017303138076189,
                                      0.0068526264525862746,
                                      0.007108168818478644,
                                      0.0073683550038720624,
                                      0.0076331825574016965,
                                      0.0079026489839738034,
                                      0.00817675174478899,
                                      0.0084554882573663614,
                                      0.0087388558955677209,
                                      0.009026851989622442,
                                      0.0093194738261524468,
                                      0.0096167186481979083,
                                      0.0099185836552430628,
                                      0.010225066003242855,
                                      0.010536162804649529,
                                      0.010851871128439827,
                                      0.011172188000142802,
                                      0.011497110401867572,
                                      0.011826635272331965,
                                      0.012160759506891272,
                                      0.01249947995756745,
                                      0.012842793433078981,
                                      0.01319069669887063,
                                      0.013543186477144198,
                                      0.013900259446889329,
                                      0.014261912243914598,
                                      0.01462814146087954,
                                      0.014998943647326513,
                                      0.015374315309713282,
                                      0.015754252911446,
                                      0.016138752872912332,
                                      0.016527811571515394,
                                      0.016921425341707763,
                                      0.017319590475026125,
                                      0.017722303220126079,
                                      0.018129559782817495,
                                      0.018541356326100322,
                                      0.018957688970200837,
                                      0.019378553792608,
                                      0.019803946828110375,
                                      0.020233864068833818,
                                      0.020668301464278893,
                                      0.021107254921359175,
                                      0.021550720304439885,
                                      0.021998693435376748,
                                      0.022451170093555295,
                                      0.022908146015930775,
                                      0.023369616897068346,
                                      0.023835578389183487,
                                      0.024306026102182909,
                                      0.0247809556037063,
                                      0.025260362419167515,
                                      0.025744242031797371,
                                      0.026232589882685509,
                                      0.026725401370824076,
                                      0.027222671853150415,
                                      0.027724396644591254,
                                      0.028230571018106665,
                                      0.028741190204734646,
                                      0.029256249393635914,
                                      0.029775743732139537,
                                      0.030299668325788343,
                                      0.030828018238385213,
                                      0.031360788492039549,
                                      0.031897974067214063,
                                      0.032439569902772247,
                                      0.03298557089602594,
                                      0.033535971902783512,
                                      0.034090767737398164,
                                      0.034649953172816939,
                                      0.035213522940629849,
                                      0.035781471731119618,
                                      0.036353794193311695,
                                      0.036930484935024488,
                                      0.037511538522920496,
                                      0.038096949482557152,
                                      0.03868671229843873,
                                      0.039280821414068023,
                                      0.039879271231998858,
                                      0.04048205611388872,
                                      0.041089170380552154,
                                      0.041700608312013776,
                                      0.042316364147562624,
                                      0.042936432085806331,
                                      0.043560806284725473,
                                      0.04418948086172908,
                                      0.044822449893709704,
                                      0.045459707417099371,
                                      0.046101247427925762,
                                      0.046747063881868778,
                                      0.047397150694317436,
                                      0.048051501740427216,
                                      0.048710110855177846,
                                      0.049372971833431256,
                                      0.0500400784299902,
                                      0.05071142435965692,
                                      0.0513870032972924,
                                      0.05206680887787607,
                                      0.052750834696565829,
                                      0.053439074308757994,
                                      0.054131521230148583,
                                      0.054828168936793875,
                                      0.055529010865172257,
                                      0.056234040412245834,
                                      0.056943250935522882,
                                      0.057656635753120133,
                                      0.058374188143825889,
                                      0.05909590134716336,
                                      0.059821768563454336,
                                      0.060551782953883249,
                                      0.061285937640561561,
                                      0.062024225706592717,
                                      0.062766640196137036,
                                      0.063513174114477544,
                                      0.0642638204280856,
                                      0.065018572064687419,
                                      0.065777421913330636,
                                      0.066540362824451138,
                                      0.0673073876099406,
                                      0.068078489043214119,
                                      0.068853659859278327,
                                      0.069632892754799947,
                                      0.070416180388174321,
                                      0.0712035153795949,
                                      0.071994890311122661,
                                      0.072790297726755715,
                                      0.073589730132500142,
                                      0.074393179996439962,
                                      0.075200639748808584,
                                      0.076012101782059915,
                                      0.076827558450939915,
                                      0.077647002072558979,
                                      0.078470424926463889,
                                      0.079297819254711022,
                                      0.080129177261938911,
                                      0.080964491115442183,
                                      0.081803752945245112,
                                      0.082646954844175724,
                                      0.083494088867940464,
                                      0.0843451470351988,
                                      0.085200121327638711,
                                      0.086059003690052149,
                                      0.086921786030410675,
                                      0.087788460219942133,
                                      0.088659018093206643,
                                      0.089533451448174373,
                                      0.090411752046301919,
                                      0.091293911612610523,
                                      0.092179921835763845,
                                      0.093069774368146285,
                                      0.093963460825941481,
                                      0.094860972789211739,
                                      0.0957623018019767,
                                      0.096667439372293662,
                                      0.09757637697233712,
                                      0.098489106038479379,
                                      0.0994056179713711,
                                      0.10032590413602233,
                                      0.10124995586188401,
                                      0.10217776444292942,
                                      0.10310932113773646,
                                      0.10404461716956975,
                                      0.10498364372646346,
                                      0.10592639196130449,
                                      0.1068728529919154,
                                      0.10782301790113857,
                                      0.10877687773691996,
                                      0.10973442351239332,
                                      0.11069564620596517,
                                      0.11166053676139964,
                                      0.11262908608790373,
                                      0.11360128506021328,
                                      0.1145771245186783,
                                      0.11555659526935003,
                                      0.116539688084067,
                                      0.1175263937005423,
                                      0.11851670282245069,
                                      0.11951060611951614,
                                      0.12050809422759984,
                                      0.1215091577487884,
                                      0.12251378725148249,
                                      0.12352197327048553,
                                      0.12453370630709287,
                                      0.12554897682918154,
                                      0.12656777527129959,
                                      0.12759009203475674,
                                      0.1286159174877145,
                                      0.12964524196527688,
                                      0.1306780557695818,
                                      0.13171434916989178,
                                      0.13275411240268647,
                                      0.13379733567175411,
                                      0.13484400914828376,
                                      0.13589412297095838,
                                      0.136947667246047,
                                      0.13800463204749885,
                                      0.13906500741703609,
                                      0.14012878336424806,
                                      0.14119594986668521,
                                      0.14226649686995368,
                                      0.14334041428780986,
                                      0.14441769200225574,
                                      0.14549831986363371,
                                      0.14658228769072262,
                                      0.14766958527083363,
                                      0.14876020235990622,
                                      0.14985412868260511,
                                      0.15095135393241643,
                                      0.15205186777174562,
                                      0.15315565983201407,
                                      0.15426271971375727,
                                      0.15537303698672283,
                                      0.15648660118996832,
                                      0.15760340183196037,
                                      0.15872342839067294,
                                      0.1598466703136871,
                                      0.16097311701828976,
                                      0.16210275789157402,
                                      0.16323558229053881,
                                      0.164371579542189,
                                      0.16551073894363644,
                                      0.16665304976220036,
                                      0.16779850123550882,
                                      0.16894708257159979,
                                      0.17009878294902309,
                                      0.17125359151694231,
                                      0.1724114973952367,
                                      0.17357248967460431,
                                      0.17473655741666416,
                                      0.17590368965405967,
                                      0.17707387539056196,
                                      0.17824710360117302,
                                      0.17942336323223029,
                                      0.18060264320151037,
                                      0.18178493239833332,
                                      0.18297021968366778,
                                      0.18415849389023542,
                                      0.18534974382261654,
                                      0.18654395825735542,
                                      0.18774112594306591,
                                      0.18894123560053777,
                                      0.19014427592284261,
                                      0.1913502355754404,
                                      0.19255910319628677,
                                      0.19377086739593941,
                                      0.19498551675766579,
                                      0.1962030398375505,
                                      0.19742342516460326,
                                      0.19864666124086694,
                                      0.1998727365415256,
                                      0.2011016395150137,
                                      0.20233335858312423,
                                      0.20356788214111832,
                                      0.20480519855783424,
                                      0.20604529617579714,
                                      0.2072881633113291,
                                      0.20853378825465851,
                                      0.2097821592700313,
                                      0.21103326459582089,
                                      0.21228709244463906,
                                      0.21354363100344731,
                                      0.21480286843366786,
                                      0.21606479287129537,
                                      0.21732939242700866,
                                      0.21859665518628246,
                                      0.21986656920950037,
                                      0.22113912253206647,
                                      0.22241430316451871,
                                      0.22369209909264159,
                                      0.22497249827757931,
                                      0.22625548865594947,
                                      0.22754105813995623,
                                      0.22882919461750478,
                                      0.23011988595231508,
                                      0.23141311998403646,
                                      0.23270888452836147,
                                      0.23400716737714194,
                                      0.23530795629850276,
                                      0.23661123903695819,
                                      0.23791700331352633,
                                      0.23922523682584529,
                                      0.24053592724828943,
                                      0.24184906223208469,
                                      0.24316462940542594,
                                      0.24448261637359242,
                                      0.24580301071906541,
                                      0.24712580000164464,
                                      0.24845097175856617,
                                      0.24977851350461894,
                                      0.25110841273226325,
                                      0.25244065691174783,
                                      0.25377523349122832,
                                      0.25511212989688581,
                                      0.2564513335330445,
                                      0.2577928317822914,
                                      0.25913661200559385,
                                      0.26048266154242017,
                                      0.26183096771085762,
                                      0.26318151780773286,
                                      0.26453429910873083,
                                      0.2658892988685152,
                                      0.26724650432084823,
                                      0.26860590267871087,
                                      0.26996748113442393,
                                      0.27133122685976774,
                                      0.27269712700610371,
                                      0.27406516870449515,
                                      0.27543533906582895,
                                      0.27680762518093593,
                                      0.27818201412071408,
                                      0.2795584929362484,
                                      0.28093704865893465,
                                      0.2823176683006009,
                                      0.28370033885362933,
                                      0.28508504729108,
                                      0.286471780566812,
                                      0.2878605256156081,
                                      0.28925126935329637,
                                      0.29064399867687463,
                                      0.29203870046463276,
                                      0.29343536157627736,
                                      0.2948339688530548,
                                      0.29623450911787563,
                                      0.29763696917543875,
                                      0.29904133581235537,
                                      0.30044759579727376,
                                      0.30185573588100373,
                                      0.303265742796642,
                                      0.30467760325969634,
                                      0.3060913039682116,
                                      0.30750683160289405,
                                      0.30892417282723794,
                                      0.31034331428765038,
                                      0.31176424261357749,
                                      0.31318694441763045,
                                      0.31461140629571105,
                                      0.31603761482713882,
                                      0.31746555657477682,
                                      0.31889521808515869,
                                      0.320326585888615,
                                      0.32175964649940036,
                                      0.32319438641582049,
                                      0.3246307921203595,
                                      0.32606885007980707,
                                      0.327508546745386,
                                      0.32894986855287978,
                                      0.33039280192276066,
                                      0.3318373332603175,
                                      0.33328344895578355,
                                      0.33473113538446531,
                                      0.3361803789068698,
                                      0.3376311658688344,
                                      0.33908348260165455,
                                      0.340537315422213,
                                      0.34199265063310857,
                                      0.34344947452278463,
                                      0.34490777336565975,
                                      0.34636753342225535,
                                      0.34782874093932648,
                                      0.34929138214999045,
                                      0.350755443273857,
                                      0.35222091051715793,
                                      0.35368777007287761,
                                      0.35515600812088222,
                                      0.35662561082805039,
                                      0.3580965643484037,
                                      0.35956885482323664,
                                      0.361042468381248,
                                      0.36251739113867032,
                                      0.36399360919940227,
                                      0.36547110865513771,
                                      0.36694987558549863,
                                      0.3684298960581649,
                                      0.36991115612900627,
                                      0.37139364184221357,
                                      0.37287733923042965,
                                      0.374362234314882,
                                      0.37584831310551381,
                                      0.37733556160111581,
                                      0.37882396578945826,
                                      0.380313511647423,
                                      0.3818041851411354,
                                      0.38329597222609707,
                                      0.38478885884731734,
                                      0.38628283093944682,
                                      0.38777787442690859,
                                      0.38927397522403168,
                                      0.39077111923518404,
                                      0.39226929235490432,
                                      0.39376848046803586,
                                      0.3952686694498585,
                                      0.396769845166223,
                                      0.39827199347368303,
                                      0.39977510021962925,
                                      0.40127915124242219,
                                      0.40278413237152566,
                                      0.40429002942764064,
                                      0.40579682822283836,
                                      0.40730451456069455,
                                      0.40881307423642266,
                                      0.41032249303700807,
                                      0.41183275674134157,
                                      0.4133438511203541,
                                      0.41485576193714979,
                                      0.41636847494714124,
                                      0.41788197589818238,
                                      0.41939625053070423,
                                      0.420911284577848,
                                      0.42242706376560013,
                                      0.42394357381292697,
                                      0.42546080043190848,
                                      0.42697872932787384,
                                      0.42849734619953539,
                                      0.43001663673912394,
                                      0.43153658663252292,
                                      0.433057181559404,
                                      0.43457840719336105,
                                      0.43610024920204649,
                                      0.43762269324730479,
                                      0.43914572498530868,
                                      0.44066933006669368,
                                      0.44219349413669357,
                                      0.4437182028352758,
                                      0.44524344179727615,
                                      0.44676919665253506,
                                      0.44829545302603163,
                                      0.44982219653802069,
                                      0.45134941280416674,
                                      0.45287708743568095,
                                      0.45440520603945539,
                                      0.45593375421819909,
                                      0.45746271757057444,
                                      0.45899208169133165,
                                      0.46052183217144549,
                                      0.46205195459825033,
                                      0.46358243455557629,
                                      0.46511325762388495,
                                      0.46664440938040541,
                                      0.46817587539926986,
                                      0.4697076412516496,
                                      0.47123969250589121,
                                      0.472772014727652,
                                      0.47430459348003684,
                                      0.47583741432373317,
                                      0.47737046281714812,
                                      0.47890372451654317,
                                      0.48043718497617188,
                                      0.48197082974841465,
                                      0.48350464438391577,
                                      0.48503861443171892,
                                      0.48657272543940328,
                                      0.48810696295322054,
                                      0.48964131251822995,
                                      0.49117575967843563,
                                      0.49271028997692179,
                                      0.49424488895598934,
                                      0.4957795421572922,
                                      0.49731423512197365,
                                      0.49884895339080193,
                                      0.50038368250430743,
                                      0.50191840800291765,
                                      0.50345311542709448,
                                      0.50498779031747043,
                                      0.50652241821498389,
                                      0.5080569846610169,
                                      0.50959147519752934,
                                      0.51112587536719711,
                                      0.51266017071354719,
                                      0.51419434678109421,
                                      0.5157283891154768,
                                      0.51726228326359314,
                                      0.51879601477373782,
                                      0.52032956919573758,
                                      0.52186293208108814,
                                      0.52339608898308909,
                                      0.52492902545698117,
                                      0.52646172706008143,
                                      0.5279941793519205,
                                      0.52952636789437724,
                                      0.531058278251816,
                                      0.53258989599122131,
                                      0.53412120668233543,
                                      0.53565219589779312,
                                      0.537182849213258,
                                      0.53871315220755833,
                                      0.540243090462823,
                                      0.54177264956461746,
                                      0.54330181510207909,
                                      0.54483057266805368,
                                      0.54635890785923014,
                                      0.54788680627627739,
                                      0.54941425352397932,
                                      0.55094123521137028,
                                      0.55246773695187146,
                                      0.55399374436342519,
                                      0.55551924306863176,
                                      0.557044218694884,
                                      0.558568656874503,
                                      0.56009254324487356,
                                      0.56161586344857939,
                                      0.563138603133538,
                                      0.56466074795313692,
                                      0.56618228356636791,
                                      0.56770319563796223,
                                      0.56922346983852634,
                                      0.570743091844676,
                                      0.57226204733917208,
                                      0.57378032201105478,
                                      0.57529790155577887,
                                      0.576814771675348,
                                      0.57833091807845027,
                                      0.57984632648059176,
                                      0.5813609826042323,
                                      0.58287487217891876,
                                      0.5843879809414203,
                                      0.58590029463586291,
                                      0.58741179901386276,
                                      0.58892247983466184,
                                      0.59043232286526059,
                                      0.59194131388055327,
                                      0.593449438663461,
                                      0.59495668300506688,
                                      0.59646303270474832,
                                      0.59796847357031246,
                                      0.59947299141812849,
                                      0.60097657207326216,
                                      0.602479201369609,
                                      0.6039808651500278,
                                      0.60548154926647435,
                                      0.60698123958013384,
                                      0.60847992196155509,
                                      0.60997758229078314,
                                      0.6114742064574924,
                                      0.61296978036111949,
                                      0.61446428991099611,
                                      0.61595772102648194,
                                      0.6174500596370972,
                                      0.61894129168265555,
                                      0.62043140311339551,
                                      0.62192037989011428,
                                      0.62340820798429875,
                                      0.62489487337825866,
                                      0.62638036206525793,
                                      0.62786466004964736,
                                      0.629347753346995,
                                      0.63082962798422026,
                                      0.63231026999972351,
                                      0.63378966544351822,
                                      0.6352678003773633,
                                      0.63674466087489268,
                                      0.63822023302174835,
                                      0.63969450291571006,
                                      0.64116745666682706,
                                      0.6426390803975488,
                                      0.64410936024285537,
                                      0.64557828235038839,
                                      0.647045832880582,
                                      0.64851199800679227,
                                      0.64997676391542814,
                                      0.65144011680608127,
                                      0.65290204289165632,
                                      0.65436252839850084,
                                      0.65582155956653432,
                                      0.65727912264937938,
                                      0.65873520391448925,
                                      0.66018978964327912,
                                      0.66164286613125389,
                                      0.66309441968813809,
                                      0.664544436638005,
                                      0.66599290331940453,
                                      0.66743980608549314,
                                      0.66888513130416127,
                                      0.670328865358163,
                                      0.67177099464524337,
                                      0.6732115055782667,
                                      0.67465038458534488,
                                      0.67608761810996543,
                                      0.67752319261111849,
                                      0.6789570945634249,
                                      0.6803893104572637,
                                      0.68181982679889908,
                                      0.683248630110608,
                                      0.68467570693080648,
                                      0.68610104381417747,
                                      0.68752462733179565,
                                      0.6889464440712566,
                                      0.69036648063680073,
                                      0.691784723649441,
                                      0.69320115974708851,
                                      0.69461577558467757,
                                      0.6960285578342934,
                                      0.69743949318529563,
                                      0.698848568344445,
                                      0.7002557700360279,
                                      0.70166108500198221,
                                      0.70306450000202114,
                                      0.70446600181375918,
                                      0.70586557723283561,
                                      0.70726321307303985,
                                      0.7086588961664344,
                                      0.7100526133634808,
                                      0.71144435153316155,
                                      0.712834097563105,
                                      0.71422183835970876,
                                      0.71560756084826294,
                                      0.71699125197307279,
                                      0.71837289869758281,
                                      0.71975248800449876,
                                      0.72113000689591056,
                                      0.72250544239341452,
                                      0.72387878153823582,
                                      0.72525001139135137,
                                      0.72661911903360943,
                                      0.727986091565854,
                                      0.72935091610904523,
                                      0.73071357980438012,
                                      0.7320740698134145,
                                      0.73343237331818367,
                                      0.7347884775213237,
                                      0.73614236964619117,
                                      0.73749403693698368,
                                      0.738843466658861,
                                      0.74019064609806373,
                                      0.74153556256203368,
                                      0.74287820337953381,
                                      0.74421855590076713,
                                      0.74555660749749619,
                                      0.74689234556316131,
                                      0.74822575751300047,
                                      0.74955683078416735,
                                      0.75088555283584935,
                                      0.75221191114938635,
                                      0.753535893228388,
                                      0.75485748659885221,
                                      0.75617667880928208,
                                      0.75749345743080343,
                                      0.75880781005728237,
                                      0.76011972430544106,
                                      0.76142918781497526,
                                      0.76273618824867073,
                                      0.764040713292519,
                                      0.76534275065583435,
                                      0.76664228807136781,
                                      0.76793931329542464,
                                      0.76923381410797909,
                                      0.77052577831278857,
                                      0.77181519373751006,
                                      0.77310204823381379,
                                      0.77438632967749821,
                                      0.7756680259686034,
                                      0.77694712503152619,
                                      0.77822361481513347,
                                      0.77949748329287527,
                                      0.78076871846289841,
                                      0.78203730834816021,
                                      0.78330324099654036,
                                      0.78456650448095366,
                                      0.78582708689946323,
                                      0.78708497637539154,
                                      0.78834016105743354,
                                      0.78959262911976658,
                                      0.790842368762164,
                                      0.792089368210104,
                                      0.79333361571488259,
                                      0.79457509955372307,
                                      0.7958138080298871,
                                      0.79704972947278452,
                                      0.79828285223808315,
                                      0.79951316470781908,
                                      0.80074065529050575,
                                      0.80196531242124358,
                                      0.80318712456182761,
                                      0.804406080200858,
                                      0.80562216785384777,
                                      0.80683537606333022,
                                      0.80804569339896815,
                                      0.80925310845766063,
                                      0.81045760986365112,
                                      0.81165918626863354,
                                      0.81285782635186088,
                                      0.81405351882025045,
                                      0.81524625240849069,
                                      0.81643601587914716,
                                      0.81762279802276927,
                                      0.81880658765799486,
                                      0.81998737363165575,
                                      0.82116514481888325,
                                      0.82233989012321262,
                                      0.82351159847668809,
                                      0.8246802588399661,
                                      0.82584586020242035,
                                      0.827008391582245,
                                      0.8281678420265588,
                                      0.82932420061150691,
                                      0.83047745644236526,
                                      0.83162759865364277,
                                      0.83277461640918315,
                                      0.83391849890226755,
                                      0.83505923535571636,
                                      0.83619681502199072,
                                      0.83733122718329334,
                                      0.83846246115166989,
                                      0.83959050626910992,
                                      0.840715351907647,
                                      0.84183698746945845,
                                      0.84295540238696576,
                                      0.8440705861229344,
                                      0.84518252817057193,
                                      0.84629121805362817,
                                      0.84739664532649361,
                                      0.84849879957429764,
                                      0.84959767041300593,
                                      0.85069324748952013,
                                      0.85178552048177358,
                                      0.85287447909883007,
                                      0.85396011308097908,
                                      0.855042412199834,
                                      0.85612136625842816,
                                      0.85719696509130983,
                                      0.85826919856463957,
                                      0.85933805657628448,
                                      0.860403529055914,
                                      0.86146560596509458,
                                      0.86252427729738423,
                                      0.86357953307842727,
                                      0.8646313633660474,
                                      0.86567975825034216,
                                      0.866724707853776,
                                      0.86776620233127333,
                                      0.86880423187031108,
                                      0.86983878669101178,
                                      0.870869857046235,
                                      0.87189743322166979,
                                      0.87292150553592518,
                                      0.87394206434062283,
                                      0.87495910002048727,
                                      0.87597260299343582,
                                      0.87698256371066985,
                                      0.87798897265676423,
                                      0.87899182034975754,
                                      0.87999109734124037,
                                      0.8809867942164451,
                                      0.881978901594335,
                                      0.88296741012769153,
                                      0.883952310503203,
                                      0.88493359344155231,
                                      0.88591124969750457,
                                      0.88688527005999385,
                                      0.88785564535220984,
                                      0.88882236643168466,
                                      0.88978542419037931,
                                      0.89074480955476831,
                                      0.89170051348592627,
                                      0.892652526979613,
                                      0.89360084106635784,
                                      0.89454544681154413,
                                      0.895486335315494,
                                      0.8964234977135519,
                                      0.89735692517616794,
                                      0.89828660890898093,
                                      0.89921254015290208,
                                      0.90013471018419644,
                                      0.901053110314566,
                                      0.901967731891231,
                                      0.9028785662970118,
                                      0.90378560495040983,
                                      0.90468883930568811,
                                      0.90558826085295263,
                                      0.9064838611182322,
                                      0.9073756316635575,
                                      0.90826356408704179,
                                      0.90914765002295916,
                                      0.91002788114182376,
                                      0.9109042491504683,
                                      0.911776745792122,
                                      0.91264536284648856,
                                      0.9135100921298237,
                                      0.91437092549501142,
                                      0.91522785483164215,
                                      0.91608087206608824,
                                      0.91692996916157987,
                                      0.91777513811828138,
                                      0.91861637097336635,
                                      0.91945365980109306,
                                      0.920286996712878,
                                      0.92111637385737133,
                                      0.92194178342053057,
                                      0.92276321762569413,
                                      0.9235806687336543,
                                      0.92439412904273055,
                                      0.92520359088884241,
                                      0.92600904664558037,
                                      0.92681048872427918,
                                      0.927607909574089,
                                      0.92840130168204582,
                                      0.92919065757314279,
                                      0.92997596981040109,
                                      0.93075723099493879,
                                      0.93153443376604206,
                                      0.93230757080123294,
                                      0.93307663481633973,
                                      0.93384161856556469,
                                      0.93460251484155255,
                                      0.93535931647545889,
                                      0.93611201633701713,
                                      0.93686060733460552,
                                      0.93760508241531482,
                                      0.93834543456501385,
                                      0.93908165680841615,
                                      0.93981374220914538,
                                      0.94054168386980086,
                                      0.94126547493202251,
                                      0.94198510857655537,
                                      0.94270057802331375,
                                      0.94341187653144587,
                                      0.944118997399396,
                                      0.94482193396496916,
                                      0.94552067960539232,
                                      0.94621522773737832,
                                      0.9469055718171866,
                                      0.94759170534068582,
                                      0.94827362184341424,
                                      0.94895131490064166,
                                      0.94962477812742918,
                                      0.95029400517868945,
                                      0.95095898974924664,
                                      0.951619725573896,
                                      0.95227620642746247,
                                      0.95292842612485962,
                                      0.95357637852114774,
                                      0.954220057511592,
                                      0.95485945703171971,
                                      0.95549457105737745,
                                      0.956125393604788,
                                      0.95675191873060683,
                                      0.95737414053197778,
                                      0.95799205314658842,
                                      0.95860565075272641,
                                      0.95921492756933313,
                                      0.9598198778560586,
                                      0.9604204959133158,
                                      0.96101677608233382,
                                      0.961608712745212,
                                      0.96219630032497183,
                                      0.9627795332856105,
                                      0.9633584061321524,
                                      0.963932913410701,
                                      0.96450304970849032,
                                      0.965068809653936,
                                      0.965630187916686,
                                      0.96618717920767039,
                                      0.96673977827915136,
                                      0.967287979924773,
                                      0.96783177897961015,
                                      0.96837117032021669,
                                      0.96890614886467419,
                                      0.96943670957264017,
                                      0.96996284744539452,
                                      0.9704845575258878,
                                      0.97100183489878678,
                                      0.97151467469052188,
                                      0.97202307206933225,
                                      0.97252702224531151,
                                      0.97302652047045324,
                                      0.97352156203869522,
                                      0.974012142285964,
                                      0.97449825659021894,
                                      0.9749799003714954,
                                      0.9754570690919484,
                                      0.9759297582558949,
                                      0.97639796340985652,
                                      0.97686168014260133,
                                      0.9773209040851849,
                                      0.97777563091099284,
                                      0.97822585633578019,
                                      0.97867157611771227,
                                      0.97911278605740493,
                                      0.97954948199796354,
                                      0.97998165982502283,
                                      0.980409315466785,
                                      0.98083244489405863,
                                      0.98125104412029585,
                                      0.9816651092016313,
                                      0.9820746362369176,
                                      0.98247962136776346,
                                      0.98288006077856926,
                                      0.98327595069656359,
                                      0.98366728739183773,
                                      0.98405406717738231,
                                      0.98443628640912073,
                                      0.984813941485944,
                                      0.98518702884974529,
                                      0.985555544985452,
                                      0.98591948642106031,
                                      0.98627884972766688,
                                      0.98663363151950212,
                                      0.98698382845396093,
                                      0.98732943723163535,
                                      0.98767045459634473,
                                      0.9880068773351669,
                                      0.98833870227846843,
                                      0.988665926299934,
                                      0.98898854631659683,
                                      0.98930655928886679,
                                      0.98961996222055937,
                                      0.989928752158924,
                                      0.99023292619467163,
                                      0.99053248146200246,
                                      0.99082741513863315,
                                      0.99111772444582213,
                                      0.99140340664839766,
                                      0.991684459054782,
                                      0.99196087901701746,
                                      0.99223266393079168,
                                      0.99249981123546138,
                                      0.99276231841407714,
                                      0.99302018299340666,
                                      0.99327340254395835,
                                      0.99352197468000414,
                                      0.99376589705960194,
                                      0.99400516738461775,
                                      0.994239783400747,
                                      0.99446974289753642,
                                      0.99469504370840445,
                                      0.99491568371066152,
                                      0.99513166082553028,
                                      0.99534297301816532,
                                      0.99554961829767208,
                                      0.99575159471712549,
                                      0.99594890037358885,
                                      0.99614153340813116,
                                      0.996329492005845,
                                      0.9965127743958635,
                                      0.99669137885137726,
                                      0.99686530368965,
                                      0.99703454727203522,
                                      0.997199108003991,
                                      0.9973589843350954,
                                      0.99751417475906079,
                                      0.99766467781374835,
                                      0.99781049208118144,
                                      0.99795161618755968,
                                      0.99808804880327084,
                                      0.99821978864290439,
                                      0.99834683446526284,
                                      0.998469185073374,
                                      0.99858683931450165,
                                      0.99869979608015735,
                                      0.99880805430610986,
                                      0.99891161297239561,
                                      0.99901047110332852,
                                      0.99910462776750886,
                                      0.99919408207783222,
                                      0.99927883319149746,
                                      0.9993588803100153,
                                      0.99943422267921567,
                                      0.99950485958925439,
                                      0.99957079037462,
                                      0.99963201441414062,
                                      0.9996885311309891,
                                      0.99974033999268852,
                                      0.99978744051111779,
                                      0.99982983224251543,
                                      0.99986751478748448,
                                      0.99990048779099583,
                                      0.99992875094239175,
                                      0.99995230397538859,
                                      0.99997114666807985,
                                      0.99998527884293731,
                                      0.99999470036681382,
                                      0.9999994111509436,
                                      0.9999994111509436,
                                      0.99999470036681382,
                                      0.99998527884293731,
                                      0.99997114666807985,
                                      0.99995230397538859,
                                      0.99992875094239175,
                                      0.99990048779099583,
                                      0.99986751478748448,
                                      0.99982983224251543,
                                      0.99978744051111779,
                                      0.99974033999268852,
                                      0.9996885311309891,
                                      0.99963201441414073,
                                      0.99957079037462,
                                      0.99950485958925439,
                                      0.99943422267921567,
                                      0.9993588803100153,
                                      0.99927883319149746,
                                      0.99919408207783222,
                                      0.99910462776750886,
                                      0.99901047110332863,
                                      0.99891161297239561,
                                      0.99880805430611,
                                      0.99869979608015735,
                                      0.99858683931450165,
                                      0.998469185073374,
                                      0.99834683446526284,
                                      0.9982197886429045,
                                      0.99808804880327084,
                                      0.99795161618755968,
                                      0.99781049208118144,
                                      0.99766467781374835,
                                      0.99751417475906079,
                                      0.9973589843350954,
                                      0.997199108003991,
                                      0.99703454727203522,
                                      0.99686530368965,
                                      0.99669137885137726,
                                      0.9965127743958635,
                                      0.996329492005845,
                                      0.99614153340813116,
                                      0.99594890037358885,
                                      0.9957515947171256,
                                      0.99554961829767208,
                                      0.99534297301816532,
                                      0.99513166082553028,
                                      0.99491568371066152,
                                      0.99469504370840456,
                                      0.99446974289753642,
                                      0.994239783400747,
                                      0.99400516738461775,
                                      0.99376589705960194,
                                      0.99352197468000414,
                                      0.99327340254395846,
                                      0.99302018299340666,
                                      0.99276231841407714,
                                      0.99249981123546149,
                                      0.99223266393079168,
                                      0.99196087901701746,
                                      0.991684459054782,
                                      0.99140340664839766,
                                      0.99111772444582225,
                                      0.99082741513863315,
                                      0.99053248146200257,
                                      0.99023292619467163,
                                      0.989928752158924,
                                      0.98961996222055937,
                                      0.98930655928886679,
                                      0.98898854631659683,
                                      0.988665926299934,
                                      0.98833870227846843,
                                      0.9880068773351669,
                                      0.98767045459634473,
                                      0.98732943723163547,
                                      0.986983828453961,
                                      0.98663363151950212,
                                      0.98627884972766688,
                                      0.98591948642106031,
                                      0.98555554498545206,
                                      0.98518702884974529,
                                      0.984813941485944,
                                      0.98443628640912073,
                                      0.98405406717738231,
                                      0.98366728739183773,
                                      0.98327595069656359,
                                      0.98288006077856949,
                                      0.98247962136776357,
                                      0.9820746362369176,
                                      0.9816651092016313,
                                      0.981251044120296,
                                      0.98083244489405852,
                                      0.980409315466785,
                                      0.97998165982502294,
                                      0.97954948199796377,
                                      0.97911278605740493,
                                      0.97867157611771238,
                                      0.9782258563357803,
                                      0.97777563091099284,
                                      0.9773209040851849,
                                      0.97686168014260122,
                                      0.97639796340985652,
                                      0.975929758255895,
                                      0.9754570690919484,
                                      0.9749799003714954,
                                      0.97449825659021894,
                                      0.974012142285964,
                                      0.97352156203869522,
                                      0.97302652047045335,
                                      0.97252702224531151,
                                      0.97202307206933214,
                                      0.97151467469052188,
                                      0.97100183489878689,
                                      0.9704845575258878,
                                      0.96996284744539463,
                                      0.96943670957264017,
                                      0.9689061488646743,
                                      0.96837117032021669,
                                      0.96783177897961026,
                                      0.96728797992477311,
                                      0.96673977827915136,
                                      0.96618717920767039,
                                      0.96563018791668609,
                                      0.96506880965393615,
                                      0.96450304970849032,
                                      0.96393291341070109,
                                      0.96335840613215251,
                                      0.96277953328561061,
                                      0.96219630032497183,
                                      0.961608712745212,
                                      0.96101677608233382,
                                      0.96042049591331569,
                                      0.9598198778560586,
                                      0.95921492756933313,
                                      0.95860565075272652,
                                      0.95799205314658853,
                                      0.95737414053197778,
                                      0.95675191873060694,
                                      0.95612539360478821,
                                      0.95549457105737734,
                                      0.95485945703171971,
                                      0.954220057511592,
                                      0.95357637852114774,
                                      0.95292842612485962,
                                      0.95227620642746258,
                                      0.95161972557389607,
                                      0.95095898974924664,
                                      0.95029400517868945,
                                      0.94962477812742918,
                                      0.94895131490064166,
                                      0.94827362184341424,
                                      0.94759170534068571,
                                      0.94690557181718671,
                                      0.94621522773737832,
                                      0.94552067960539243,
                                      0.94482193396496927,
                                      0.9441189973993962,
                                      0.94341187653144587,
                                      0.94270057802331386,
                                      0.94198510857655537,
                                      0.94126547493202262,
                                      0.94054168386980086,
                                      0.93981374220914549,
                                      0.93908165680841627,
                                      0.938345434565014,
                                      0.93760508241531482,
                                      0.93686060733460563,
                                      0.93611201633701724,
                                      0.935359316475459,
                                      0.93460251484155243,
                                      0.93384161856556458,
                                      0.93307663481633973,
                                      0.93230757080123294,
                                      0.93153443376604206,
                                      0.930757230994939,
                                      0.92997596981040109,
                                      0.9291906575731429,
                                      0.92840130168204582,
                                      0.92760790957408912,
                                      0.92681048872427918,
                                      0.92600904664558026,
                                      0.9252035908888423,
                                      0.92439412904273066,
                                      0.9235806687336543,
                                      0.92276321762569413,
                                      0.92194178342053079,
                                      0.92111637385737133,
                                      0.920286996712878,
                                      0.91945365980109317,
                                      0.91861637097336657,
                                      0.91777513811828126,
                                      0.91692996916157976,
                                      0.91608087206608824,
                                      0.91522785483164237,
                                      0.91437092549501153,
                                      0.91351009212982381,
                                      0.91264536284648878,
                                      0.91177674579212209,
                                      0.91090424915046841,
                                      0.91002788114182365,
                                      0.90914765002295916,
                                      0.90826356408704179,
                                      0.90737563166355761,
                                      0.90648386111823231,
                                      0.90558826085295274,
                                      0.90468883930568822,
                                      0.90378560495040983,
                                      0.902878566297012,
                                      0.90196773189123114,
                                      0.90105311031456592,
                                      0.90013471018419633,
                                      0.89921254015290208,
                                      0.89828660890898093,
                                      0.89735692517616794,
                                      0.89642349771355212,
                                      0.89548633531549415,
                                      0.89454544681154424,
                                      0.89360084106635784,
                                      0.89265252697961317,
                                      0.89170051348592616,
                                      0.8907448095547682,
                                      0.88978542419037931,
                                      0.88882236643168488,
                                      0.88785564535221,
                                      0.886885270059994,
                                      0.88591124969750479,
                                      0.88493359344155242,
                                      0.883952310503203,
                                      0.88296741012769164,
                                      0.88197890159433512,
                                      0.8809867942164451,
                                      0.87999109734124037,
                                      0.87899182034975754,
                                      0.87798897265676445,
                                      0.87698256371066985,
                                      0.87597260299343593,
                                      0.87495910002048738,
                                      0.873942064340623,
                                      0.87292150553592518,
                                      0.87189743322166968,
                                      0.8708698570462351,
                                      0.86983878669101178,
                                      0.86880423187031108,
                                      0.86776620233127333,
                                      0.8667247078537762,
                                      0.86567975825034227,
                                      0.86463136336604762,
                                      0.8635795330784275,
                                      0.86252427729738435,
                                      0.86146560596509447,
                                      0.860403529055914,
                                      0.85933805657628459,
                                      0.85826919856463957,
                                      0.85719696509130994,
                                      0.85612136625842827,
                                      0.85504241219983435,
                                      0.85396011308097908,
                                      0.85287447909883007,
                                      0.85178552048177381,
                                      0.85069324748952,
                                      0.84959767041300593,
                                      0.84849879957429764,
                                      0.84739664532649384,
                                      0.84629121805362839,
                                      0.845182528170572,
                                      0.84407058612293451,
                                      0.84295540238696609,
                                      0.84183698746945845,
                                      0.84071535190764712,
                                      0.83959050626911,
                                      0.83846246115166978,
                                      0.83733122718329323,
                                      0.83619681502199072,
                                      0.83505923535571658,
                                      0.83391849890226766,
                                      0.83277461640918327,
                                      0.831627598653643,
                                      0.83047745644236559,
                                      0.82932420061150691,
                                      0.8281678420265588,
                                      0.82700839158224526,
                                      0.82584586020242068,
                                      0.82468025883996632,
                                      0.82351159847668831,
                                      0.82233989012321285,
                                      0.82116514481888314,
                                      0.81998737363165586,
                                      0.81880658765799486,
                                      0.81762279802276916,
                                      0.81643601587914727,
                                      0.81524625240849058,
                                      0.81405351882025034,
                                      0.8128578263518611,
                                      0.81165918626863376,
                                      0.810457609863651,
                                      0.80925310845766085,
                                      0.80804569339896826,
                                      0.80683537606333056,
                                      0.805622167853848,
                                      0.80440608020085813,
                                      0.80318712456182784,
                                      0.80196531242124369,
                                      0.80074065529050609,
                                      0.79951316470781952,
                                      0.798282852238083,
                                      0.7970497294727843,
                                      0.79581380802988722,
                                      0.79457509955372307,
                                      0.7933336157148827,
                                      0.792089368210104,
                                      0.79084236876216374,
                                      0.7895926291197668,
                                      0.78834016105743365,
                                      0.78708497637539165,
                                      0.78582708689946346,
                                      0.78456650448095377,
                                      0.78330324099654025,
                                      0.78203730834816043,
                                      0.78076871846289864,
                                      0.7794974832928756,
                                      0.7782236148151338,
                                      0.77694712503152652,
                                      0.77566802596860385,
                                      0.77438632967749843,
                                      0.77310204823381379,
                                      0.77181519373751017,
                                      0.77052577831278857,
                                      0.76923381410797886,
                                      0.76793931329542475,
                                      0.76664228807136769,
                                      0.76534275065583457,
                                      0.76404071329251932,
                                      0.76273618824867073,
                                      0.76142918781497548,
                                      0.76011972430544117,
                                      0.75880781005728237,
                                      0.75749345743080376,
                                      0.75617667880928208,
                                      0.75485748659885221,
                                      0.75353589322838821,
                                      0.75221191114938657,
                                      0.7508855528358499,
                                      0.74955683078416779,
                                      0.7482257575130008,
                                      0.74689234556316142,
                                      0.74555660749749608,
                                      0.744218555900767,
                                      0.74287820337953392,
                                      0.74153556256203357,
                                      0.7401906460980634,
                                      0.73884346665886114,
                                      0.73749403693698379,
                                      0.73614236964619151,
                                      0.734788477521324,
                                      0.73343237331818378,
                                      0.73207406981341472,
                                      0.73071357980438023,
                                      0.72935091610904523,
                                      0.72798609156585437,
                                      0.72661911903360954,
                                      0.72525001139135126,
                                      0.72387878153823637,
                                      0.72250544239341474,
                                      0.72113000689591111,
                                      0.71975248800449887,
                                      0.71837289869758281,
                                      0.7169912519730729,
                                      0.71560756084826282,
                                      0.71422183835970865,
                                      0.71283409756310512,
                                      0.71144435153316143,
                                      0.71005261336348069,
                                      0.70865889616643463,
                                      0.70726321307303985,
                                      0.705865577232836,
                                      0.7044660018137594,
                                      0.70306450000202125,
                                      0.70166108500198254,
                                      0.70025577003602812,
                                      0.698848568344445,
                                      0.697439493185296,
                                      0.69602855783429363,
                                      0.6946157755846778,
                                      0.69320115974708885,
                                      0.691784723649441,
                                      0.690366480636801,
                                      0.6889464440712566,
                                      0.68752462733179565,
                                      0.68610104381417747,
                                      0.68467570693080659,
                                      0.68324863011060788,
                                      0.6818198267988993,
                                      0.6803893104572637,
                                      0.67895709456342479,
                                      0.67752319261111871,
                                      0.67608761810996554,
                                      0.67465038458534488,
                                      0.67321150557826692,
                                      0.67177099464524348,
                                      0.67032886535816349,
                                      0.66888513130416161,
                                      0.66743980608549314,
                                      0.665992903319405,
                                      0.66454443663800522,
                                      0.66309441968813787,
                                      0.66164286613125389,
                                      0.660189789643279,
                                      0.658735203914489,
                                      0.65727912264937938,
                                      0.65582155956653432,
                                      0.65436252839850106,
                                      0.65290204289165643,
                                      0.65144011680608127,
                                      0.64997676391542836,
                                      0.64851199800679238,
                                      0.647045832880582,
                                      0.64557828235038872,
                                      0.64410936024285537,
                                      0.6426390803975488,
                                      0.6411674566668274,
                                      0.63969450291571028,
                                      0.6382202330217488,
                                      0.636744660874893,
                                      0.635267800377363,
                                      0.63378966544351834,
                                      0.6323102699997234,
                                      0.63082962798422,
                                      0.62934775334699511,
                                      0.62786466004964714,
                                      0.62638036206525793,
                                      0.62489487337825877,
                                      0.62340820798429875,
                                      0.62192037989011451,
                                      0.62043140311339562,
                                      0.61894129168265555,
                                      0.61745005963709754,
                                      0.615957721026482,
                                      0.61446428991099611,
                                      0.61296978036111982,
                                      0.61147420645749262,
                                      0.60997758229078325,
                                      0.60847992196155554,
                                      0.60698123958013406,
                                      0.60548154926647435,
                                      0.6039808651500278,
                                      0.60247920136960875,
                                      0.60097657207326227,
                                      0.59947299141812849,
                                      0.59796847357031235,
                                      0.59646303270474854,
                                      0.59495668300506688,
                                      0.59344943866346089,
                                      0.59194131388055338,
                                      0.59043232286526059,
                                      0.58892247983466217,
                                      0.587411799013863,
                                      0.58590029463586291,
                                      0.58438798094142064,
                                      0.58287487217891887,
                                      0.58136098260423241,
                                      0.5798463264805922,
                                      0.5783309180784505,
                                      0.57681477167534811,
                                      0.57529790155577876,
                                      0.57378032201105467,
                                      0.57226204733917219,
                                      0.570743091844676,
                                      0.56922346983852612,
                                      0.56770319563796234,
                                      0.56618228356636791,
                                      0.56466074795313681,
                                      0.56313860313353825,
                                      0.56161586344857939,
                                      0.56009254324487356,
                                      0.55856865687450319,
                                      0.55704421869488407,
                                      0.5555192430686321,
                                      0.55399374436342541,
                                      0.55246773695187157,
                                      0.55094123521137073,
                                      0.54941425352397955,
                                      0.5478868062762775,
                                      0.54635890785923058,
                                      0.54483057266805346,
                                      0.54330181510207887,
                                      0.54177264956461746,
                                      0.54024309046282293,
                                      0.53871315220755855,
                                      0.5371828492132581,
                                      0.53565219589779312,
                                      0.53412120668233565,
                                      0.53258989599122142,
                                      0.53105827825181584,
                                      0.52952636789437757,
                                      0.52799417935192061,
                                      0.52646172706008143,
                                      0.52492902545698139,
                                      0.5233960889830892,
                                      0.52186293208108858,
                                      0.520329569195738,
                                      0.51879601477373793,
                                      0.51726228326359358,
                                      0.51572838911547714,
                                      0.514194346781094,
                                      0.5126601707135473,
                                      0.511125875367197,
                                      0.50959147519752912,
                                      0.5080569846610169,
                                      0.506522418214984,
                                      0.50498779031747065,
                                      0.50345311542709459,
                                      0.50191840800291754,
                                      0.50038368250430765,
                                      0.49884895339080221,
                                      0.4973142351219737,
                                      0.49577954215729259,
                                      0.49424488895598945,
                                      0.49271028997692179,
                                      0.491175759678436,
                                      0.48964131251823018,
                                      0.488106962953221,
                                      0.48657272543940361,
                                      0.48503861443171908,
                                      0.48350464438391588,
                                      0.48197082974841465,
                                      0.48043718497617166,
                                      0.47890372451654328,
                                      0.477370462817148,
                                      0.47583741432373311,
                                      0.47430459348003695,
                                      0.472772014727652,
                                      0.47123969250589143,
                                      0.46970764125164977,
                                      0.46817587539926986,
                                      0.46664440938040574,
                                      0.46511325762388517,
                                      0.46358243455557629,
                                      0.46205195459825066,
                                      0.46052183217144571,
                                      0.45899208169133177,
                                      0.45746271757057477,
                                      0.45593375421819932,
                                      0.45440520603945583,
                                      0.45287708743568095,
                                      0.45134941280416668,
                                      0.4498221965380208,
                                      0.44829545302603163,
                                      0.44676919665253484,
                                      0.44524344179727637,
                                      0.4437182028352758,
                                      0.44219349413669345,
                                      0.44066933006669379,
                                      0.43914572498530868,
                                      0.43762269324730513,
                                      0.43610024920204671,
                                      0.43457840719336122,
                                      0.43305718155940431,
                                      0.4315365866325232,
                                      0.43001663673912405,
                                      0.42849734619953583,
                                      0.42697872932787406,
                                      0.42546080043190859,
                                      0.42394357381292735,
                                      0.4224270637656,
                                      0.4209112845778481,
                                      0.41939625053070423,
                                      0.41788197589818232,
                                      0.41636847494714135,
                                      0.4148557619371499,
                                      0.413343851120354,
                                      0.41183275674134179,
                                      0.41032249303700807,
                                      0.40881307423642255,
                                      0.40730451456069477,
                                      0.40579682822283847,
                                      0.404290029427641,
                                      0.40278413237152594,
                                      0.40127915124242231,
                                      0.3997751002196297,
                                      0.39827199347368336,
                                      0.3967698451662231,
                                      0.39526866944985894,
                                      0.39376848046803609,
                                      0.3922692923549041,
                                      0.39077111923518404,
                                      0.38927397522403162,
                                      0.3877778744269087,
                                      0.38628283093944682,
                                      0.38478885884731734,
                                      0.38329597222609729,
                                      0.38180418514113551,
                                      0.38031351164742289,
                                      0.37882396578945854,
                                      0.37733556160111592,
                                      0.37584831310551381,
                                      0.37436223431488225,
                                      0.37287733923042976,
                                      0.37139364184221391,
                                      0.3699111561290066,
                                      0.36842989605816512,
                                      0.36694987558549907,
                                      0.36547110865513804,
                                      0.36399360919940238,
                                      0.36251739113867043,
                                      0.36104246838124787,
                                      0.35956885482323647,
                                      0.3580965643484037,
                                      0.35662561082805033,
                                      0.35515600812088244,
                                      0.35368777007287772,
                                      0.35222091051715793,
                                      0.35075544327385721,
                                      0.34929138214999056,
                                      0.34782874093932648,
                                      0.34636753342225568,
                                      0.34490777336565986,
                                      0.34344947452278468,
                                      0.3419926506331088,
                                      0.34053731542221322,
                                      0.33908348260165511,
                                      0.33763116586883474,
                                      0.33618037890687,
                                      0.33473113538446575,
                                      0.33328344895578355,
                                      0.33183733326031728,
                                      0.33039280192276077,
                                      0.32894986855287967,
                                      0.32750854674538576,
                                      0.32606885007980718,
                                      0.3246307921203595,
                                      0.32319438641582082,
                                      0.32175964649940048,
                                      0.320326585888615,
                                      0.31889521808515897,
                                      0.31746555657477704,
                                      0.31603761482713882,
                                      0.31461140629571133,
                                      0.31318694441763062,
                                      0.3117642426135776,
                                      0.31034331428765072,
                                      0.30892417282723816,
                                      0.30750683160289416,
                                      0.30609130396821194,
                                      0.30467760325969623,
                                      0.30326574279664209,
                                      0.30185573588100373,
                                      0.30044759579727354,
                                      0.29904133581235548,
                                      0.29763696917543875,
                                      0.29623450911787552,
                                      0.29483396885305491,
                                      0.29343536157627736,
                                      0.29203870046463265,
                                      0.29064399867687485,
                                      0.28925126935329648,
                                      0.28786052561560838,
                                      0.28647178056681222,
                                      0.28508504729108,
                                      0.28370033885362972,
                                      0.28231766830060107,
                                      0.28093704865893476,
                                      0.27955849293624868,
                                      0.27818201412071425,
                                      0.27680762518093577,
                                      0.27543533906582895,
                                      0.2740651687044951,
                                      0.27269712700610382,
                                      0.27133122685976774,
                                      0.26996748113442381,
                                      0.26860590267871109,
                                      0.26724650432084823,
                                      0.26588929886851514,
                                      0.26453429910873105,
                                      0.26318151780773297,
                                      0.26183096771085762,
                                      0.26048266154242039,
                                      0.25913661200559396,
                                      0.25779283178229168,
                                      0.25645133353304483,
                                      0.25511212989688592,
                                      0.25377523349122871,
                                      0.252440656911748,
                                      0.25110841273226336,
                                      0.24977851350461905,
                                      0.24845097175856612,
                                      0.24712580000164447,
                                      0.24580301071906541,
                                      0.24448261637359231,
                                      0.2431646294054261,
                                      0.2418490622320848,
                                      0.24053592724828932,
                                      0.23922523682584551,
                                      0.23791700331352639,
                                      0.23661123903695819,
                                      0.2353079562985031,
                                      0.234007167377142,
                                      0.23270888452836147,
                                      0.23141311998403663,
                                      0.23011988595231531,
                                      0.22882919461750523,
                                      0.22754105813995651,
                                      0.22625548865594963,
                                      0.22497249827757976,
                                      0.22369209909264148,
                                      0.22241430316451849,
                                      0.22113912253206652,
                                      0.21986656920950026,
                                      0.2185966551862823,
                                      0.21732939242700872,
                                      0.21606479287129537,
                                      0.21480286843366808,
                                      0.21354363100344742,
                                      0.21228709244463906,
                                      0.21103326459582111,
                                      0.20978215927003147,
                                      0.20853378825465851,
                                      0.20728816331132932,
                                      0.20604529617579731,
                                      0.20480519855783424,
                                      0.20356788214111859,
                                      0.2023333585831244,
                                      0.20110163951501414,
                                      0.19987273654152593,
                                      0.19864666124086677,
                                      0.19742342516460337,
                                      0.19620303983755044,
                                      0.19498551675766562,
                                      0.19377086739593952,
                                      0.19255910319628677,
                                      0.19135023557544029,
                                      0.19014427592284266,
                                      0.18894123560053777,
                                      0.18774112594306619,
                                      0.18654395825735554,
                                      0.1853497438226166,
                                      0.18415849389023564,
                                      0.18297021968366789,
                                      0.18178493239833338,
                                      0.18060264320151065,
                                      0.17942336323223046,
                                      0.17824710360117307,
                                      0.17707387539056224,
                                      0.17590368965405989,
                                      0.17473655741666427,
                                      0.17357248967460431,
                                      0.17241149739523659,
                                      0.17125359151694242,
                                      0.17009878294902314,
                                      0.16894708257159968,
                                      0.16779850123550893,
                                      0.16665304976220041,
                                      0.16551073894363633,
                                      0.16437157954218912,
                                      0.16323558229053881,
                                      0.1621027578915743,
                                      0.16097311701828992,
                                      0.15984667031368716,
                                      0.15872342839067322,
                                      0.15760340183196053,
                                      0.15648660118996843,
                                      0.15537303698672311,
                                      0.15426271971375749,
                                      0.15315565983201385,
                                      0.15205186777174562,
                                      0.15095135393241638,
                                      0.14985412868260523,
                                      0.14876020235990628,
                                      0.14766958527083357,
                                      0.14658228769072273,
                                      0.14549831986363371,
                                      0.14441769200225568,
                                      0.14334041428781003,
                                      0.14226649686995374,
                                      0.14119594986668516,
                                      0.14012878336424822,
                                      0.1390650074170362,
                                      0.13800463204749913,
                                      0.13694766724604723,
                                      0.13589412297095843,
                                      0.13484400914828409,
                                      0.13379733567175434,
                                      0.13275411240268659,
                                      0.13171434916989178,
                                      0.13067805576958169,
                                      0.12964524196527671,
                                      0.1286159174877145,
                                      0.12759009203475669,
                                      0.12656777527129975,
                                      0.12554897682918154,
                                      0.12453370630709287,
                                      0.1235219732704857,
                                      0.1225137872514826,
                                      0.1215091577487884,
                                      0.1205080942276,
                                      0.11951060611951619,
                                      0.11851670282245069,
                                      0.11752639370054252,
                                      0.11653968808406712,
                                      0.11555659526935036,
                                      0.11457712451867852,
                                      0.11360128506021339,
                                      0.11262908608790406,
                                      0.11166053676139959,
                                      0.110695646205965,
                                      0.10973442351239338,
                                      0.10877687773691991,
                                      0.10782301790113852,
                                      0.10687285299191551,
                                      0.10592639196130449,
                                      0.10498364372646363,
                                      0.10404461716956981,
                                      0.10310932113773646,
                                      0.10217776444292959,
                                      0.10124995586188412,
                                      0.10032590413602233,
                                      0.099405617971371263,
                                      0.09848910603847949,
                                      0.097576376972337175,
                                      0.096667439372293884,
                                      0.095762301801976868,
                                      0.094860972789212017,
                                      0.093963460825941758,
                                      0.093069774368146119,
                                      0.0921799218357639,
                                      0.091293911612610468,
                                      0.090411752046301808,
                                      0.089533451448174428,
                                      0.0886590180932067,
                                      0.087788460219942022,
                                      0.086921786030410786,
                                      0.086059003690052149,
                                      0.085200121327638934,
                                      0.084345147035198853,
                                      0.083494088867940464,
                                      0.082646954844175891,
                                      0.081803752945245223,
                                      0.080964491115442239,
                                      0.080129177261939133,
                                      0.079297819254711133,
                                      0.078470424926464,
                                      0.0776470020725592,
                                      0.076827558450940081,
                                      0.076012101782059971,
                                      0.075200639748808584,
                                      0.074393179996439851,
                                      0.0735897301325002,
                                      0.072790297726755715,
                                      0.07199489031112255,
                                      0.071203515379595017,
                                      0.070416180388174321,
                                      0.069632892754799891,
                                      0.068853659859278438,
                                      0.068078489043214119,
                                      0.067307387609940761,
                                      0.066540362824451249,
                                      0.065777421913330691,
                                      0.065018572064687641,
                                      0.0642638204280857,
                                      0.063513174114477544,
                                      0.062766640196137258,
                                      0.062024225706592884,
                                      0.061285937640561672,
                                      0.060551782953883249,
                                      0.059821768563454281,
                                      0.059095901347163415,
                                      0.058374188143825889,
                                      0.057656635753120078,
                                      0.056943250935522993,
                                      0.056234040412245889,
                                      0.0555290108651722,
                                      0.054828168936793986,
                                      0.054131521230148638,
                                      0.053439074308757994,
                                      0.05275083469656594,
                                      0.052066808877876125,
                                      0.051387003297292566,
                                      0.050711424359657031,
                                      0.050040078429990253,
                                      0.049372971833431478,
                                      0.048710110855177957,
                                      0.048051501740427272,
                                      0.0473971506943176,
                                      0.046747063881868722,
                                      0.046101247427925651,
                                      0.045459707417099371,
                                      0.044822449893709648,
                                      0.044189480861729136,
                                      0.043560806284725473,
                                      0.042936432085806275,
                                      0.042316364147562735,
                                      0.041700608312013776,
                                      0.0410891703805521,
                                      0.040482056113888831,
                                      0.039879271231998914,
                                      0.039280821414068023,
                                      0.038686712298438841,
                                      0.038096949482557207,
                                      0.037511538522920662,
                                      0.0369304849350246,
                                      0.03635379419331175,
                                      0.03578147173111984,
                                      0.03521352294062996,
                                      0.034649953172816828,
                                      0.03409076773739822,
                                      0.033535971902783512,
                                      0.032985570896025884,
                                      0.032439569902772247,
                                      0.031897974067214008,
                                      0.031360788492039493,
                                      0.030828018238385269,
                                      0.030299668325788343,
                                      0.029775743732139648,
                                      0.029256249393635969,
                                      0.028741190204734646,
                                      0.028230571018106776,
                                      0.027724396644591365,
                                      0.027222671853150415,
                                      0.026725401370824187,
                                      0.02623258988268562,
                                      0.025744242031797371,
                                      0.025260362419167626,
                                      0.024780955603706356,
                                      0.024306026102182965,
                                      0.023835578389183487,
                                      0.02336961689706829,
                                      0.02290814601593083,
                                      0.022451170093555295,
                                      0.021998693435376693,
                                      0.021550720304439941,
                                      0.021107254921359175,
                                      0.020668301464278838,
                                      0.020233864068833873,
                                      0.019803946828110375,
                                      0.019378553792608055,
                                      0.018957688970200892,
                                      0.018541356326100378,
                                      0.018129559782817606,
                                      0.017722303220126134,
                                      0.017319590475026181,
                                      0.016921425341707874,
                                      0.016527811571515449,
                                      0.016138752872912332,
                                      0.015754252911446,
                                      0.015374315309713282,
                                      0.014998943647326568,
                                      0.01462814146087954,
                                      0.014261912243914543,
                                      0.013900259446889329,
                                      0.013543186477144198,
                                      0.013190696698870574,
                                      0.012842793433078981,
                                      0.01249947995756745,
                                      0.012160759506891217,
                                      0.01182663527233202,
                                      0.011497110401867572,
                                      0.011172188000142858,
                                      0.010851871128439883,
                                      0.010536162804649529,
                                      0.010225066003242966,
                                      0.0099185836552431184,
                                      0.0096167186481979083,
                                      0.0093194738261525578,
                                      0.009026851989622442,
                                      0.0087388558955676654,
                                      0.0084554882573663614,
                                      0.0081767517447889349,
                                      0.0079026489839738034,
                                      0.007633182557401752,
                                      0.0073683550038720624,
                                      0.0071081688184786995,
                                      0.00685262645258633,
                                      0.0066017303138076189,
                                      0.00635548276598058,
                                      0.006113886129145929,
                                      0.0058769426795255431,
                                      0.00564465464950098,
                                      0.0054170242275923264,
                                      0.0051940535584377168,
                                      0.0049757447427728474,
                                      0.0047620998374117152,
                                      0.0045531208552267444,
                                      0.0043488097651298574,
                                      0.0041491684920542671,
                                      0.0039541989169362135,
                                      0.0037639028766968119,
                                      0.0035782821642254548,
                                      0.0033973385283623814,
                                      0.003221073673882302,
                                      0.0030494892614786884,
                                      0.0028825869077476196,
                                      0.00272036818517285,
                                      0.0025628346221110432,
                                      0.0024099877027770056,
                                      0.0022618288672302533,
                                      0.0021183595113609677,
                                      0.0019795809868770609,
                                      0.0018454946012914086,
                                      0.0017161016179095823,
                                      0.0015914032558178026,
                                      0.0014714006898715604,
                                      0.0013560950506845693,
                                      0.001245487424618108,
                                      0.0011395788537706397,
                                      0.0010383703359682084,
                                      0.00094186282475483551,
                                      0.0008500572293838049,
                                      0.00076295441480872528,
                                      0.00068055520167575878,
                                      0.00060286036631551632,
                                      0.00052987064073617418,
                                      0.00046158671261614659,
                                      0.00039800922529786842,
                                      0.0003391387777817445,
                                      0.00028497592472032096,
                                      0.00023552117641323367,
                                      0.0001907749988023788,
                                      0.00015073781346730541,
                                      0.0001154099976216072,
                                      8.4791884109036708E-5,
                                      5.8883761400674306E-5,
                                      3.768587359187503E-5,
                                      2.11984204002702E-5,
                                      9.421557163713512E-6,
                                      2.3553948388377322E-6,
                                      0.0};
  emxArray_creal_T *S;
  emxArray_real_T *a_average;
  emxArray_real_T *x;
  creal_T *S_data;
  double segment[2048];
  double peak_locations_data[1025];
  double peaks_data[1025];
  double cross_freq_data[1000];
  double alpha_idx_0;
  double alpha_idx_1;
  double alpha_idx_2;
  double alpha_idx_3;
  double bsum;
  double d;
  double festimation;
  double festimation1;
  double festimation1_tmp;
  double *a_average_data;
  int firstBlockLength;
  int i;
  int ib;
  int k;
  int lastBlockLength;
  int loop_ub;
  int n_segments;
  int nblocks;
  short b_tmp_data[1025];
  /*  输入参数 */
  /*  a - 时域信号 */
  /*  H - 结构高度 */
  /*  stru_material - 结构材料类型 ('钢筋混凝土结构', '钢结构', '砌体结构') */
  /*  信号预处理：减去均值 */
  for (i = 0; i < 60000; i++) {
    a[i] *= 9.81;
  }
  d = t0 * 100.0 + 1.0;
  festimation = t1 * 100.0;
  if (d > festimation) {
    i = 0;
    n_segments = 0;
  } else {
    i = (int)d - 1;
    n_segments = (int)festimation;
  }
  loop_ub = n_segments - i;
  if (loop_ub == 0) {
    festimation = 0.0;
  } else {
    if (loop_ub <= 1024) {
      firstBlockLength = loop_ub;
      lastBlockLength = 0;
      nblocks = 1;
    } else {
      firstBlockLength = 1024;
      nblocks = (unsigned short)loop_ub >> 10;
      lastBlockLength = loop_ub - (nblocks << 10);
      if (lastBlockLength > 0) {
        nblocks++;
      } else {
        lastBlockLength = 1024;
      }
    }
    festimation = a[i];
    for (k = 2; k <= firstBlockLength; k++) {
      festimation += a[(i + k) - 1];
    }
    for (ib = 2; ib <= nblocks; ib++) {
      n_segments = i + ((ib - 1) << 10);
      bsum = a[n_segments];
      if (ib == nblocks) {
        firstBlockLength = lastBlockLength;
      } else {
        firstBlockLength = 1024;
      }
      for (k = 2; k <= firstBlockLength; k++) {
        bsum += a[(n_segments + k) - 1];
      }
      festimation += bsum;
    }
  }
  festimation /= (double)(loop_ub - 1) + 1.0;
  emxInit_real_T(&a_average, 1);
  n_segments = a_average->size[0];
  a_average->size[0] = loop_ub;
  emxEnsureCapacity_real_T(a_average, n_segments);
  a_average_data = a_average->data;
  for (n_segments = 0; n_segments < loop_ub; n_segments++) {
    a_average_data[n_segments] = a[i + n_segments] - festimation;
  }
  /*  定义窗函数 */
  /*  分段FFT计算 */
  n_segments = (int)floor(((double)a_average->size[0] - 1024.0) / 1024.0);
  emxInit_creal_T(&S);
  i = S->size[0] * S->size[1];
  S->size[0] = 2048;
  S->size[1] = n_segments;
  emxEnsureCapacity_creal_T(S, i);
  S_data = S->data;
  loop_ub = n_segments << 11;
  for (i = 0; i < loop_ub; i++) {
    S_data[i].re = 0.0;
    S_data[i].im = 0.0;
  }
  for (nblocks = 0; nblocks < n_segments; nblocks++) {
    firstBlockLength = nblocks << 10;
    for (i = 0; i < 2048; i++) {
      segment[i] = a_average_data[i + firstBlockLength] * window[i];
    }
    c_FFTImplementationCallback_doH(segment, *(creal_T(*)[2048]) &
                                                 S_data[2048 * nblocks]);
  }
  emxFree_real_T(&a_average);
  /*  计算频谱平均值 */
  firstBlockLength = S->size[1] << 11;
  emxInit_real_T(&x, 2);
  i = x->size[0] * x->size[1];
  x->size[0] = 2048;
  x->size[1] = S->size[1];
  emxEnsureCapacity_real_T(x, i);
  a_average_data = x->data;
  for (k = 0; k < firstBlockLength; k++) {
    a_average_data[k] = rt_hypotd_snf(S_data[k].re, S_data[k].im);
  }
  emxFree_creal_T(&S);
  firstBlockLength = x->size[1];
  if (x->size[1] == 0) {
    memset(&segment[0], 0, 2048U * sizeof(double));
  } else {
    for (nblocks = 0; nblocks < 2048; nblocks++) {
      segment[nblocks] = a_average_data[nblocks];
    }
    for (k = 2; k <= firstBlockLength; k++) {
      n_segments = (k - 1) << 11;
      for (nblocks = 0; nblocks < 2048; nblocks++) {
        segment[nblocks] += a_average_data[n_segments + nblocks];
      }
    }
  }
  for (i = 0; i < 1025; i++) {
    f[i] = 0.048828125 * (double)i;
    P[i] = 2.0 * (segment[i] / (double)x->size[1]) / 2048.0;
  }
  emxFree_real_T(&x);
  if (stru_material == 'A') {
    firstBlockLength = 0;
  } else if (stru_material == 'B') {
    firstBlockLength = 1;
  } else if (stru_material == 'C') {
    firstBlockLength = 2;
  } else {
    firstBlockLength = -1;
  }
  switch (firstBlockLength) {
  case 0:
    alpha_idx_0 = 0.02595;
    alpha_idx_1 = 0.01258;
    alpha_idx_2 = 0.02441;
    alpha_idx_3 = 0.05;
    break;
  case 1:
    alpha_idx_0 = 0.03725;
    alpha_idx_1 = 0.01732;
    alpha_idx_2 = 0.03238;
    alpha_idx_3 = 0.02;
    break;
  case 2:
    alpha_idx_0 = 0.02415;
    alpha_idx_1 = 0.01103;
    alpha_idx_2 = 0.0203;
    alpha_idx_3 = 0.05;
    break;
  }
  /*  初始化输出变量 */
  /*  遍历计算一阶、二阶和三阶频率及阻尼比 */
  festimation1_tmp = rt_powd_snf(H, 0.9);
  festimation1 = 1.0 / (alpha_idx_0 * festimation1_tmp);
  for (lastBlockLength = 0; lastBlockLength < 3; lastBlockLength++) {
    double P_data[1025];
    double tmp_data[1025];
    double flower;
    int peak_locations_size[2];
    if (lastBlockLength + 1 == 1) {
      /*  一阶频率的范围估计 */
      flower = 1.0 / ((alpha_idx_0 + alpha_idx_2) * festimation1_tmp);
      bsum = 1.0 / ((alpha_idx_0 - alpha_idx_1) * festimation1_tmp);
    } else {
      /*  二阶和三阶频率的范围估计 */
      festimation =
          1.0 /
          ((-0.14210000000000003 * ((double)lastBlockLength - 1.0) + 0.3148) *
           alpha_idx_0 * festimation1_tmp);
      flower = 0.8 * festimation;
      bsum = 1.2 * festimation;
    }
    /*  提取频率区间内的峰值 */
    n_segments = 0;
    firstBlockLength = 0;
    for (nblocks = 0; nblocks < 1025; nblocks++) {
      d = 0.048828125 * (double)nblocks;
      if ((d >= flower) && (d <= bsum)) {
        n_segments++;
        b_tmp_data[firstBlockLength] = (short)nblocks;
        firstBlockLength++;
      }
    }
    for (i = 0; i < n_segments; i++) {
      short i1;
      i1 = b_tmp_data[i];
      P_data[i] = P[i1];
      tmp_data[i] = 0.048828125 * (double)i1;
    }
    nblocks = findpeaks(P_data, n_segments, tmp_data, peaks_data,
                        peak_locations_data, peak_locations_size);
    if ((unsigned short)(nblocks - 1) + 1 <= 2) {
      if ((unsigned short)(nblocks - 1) + 1 == 1) {
        bsum = peaks_data[0];
        firstBlockLength = 1;
      } else {
        bsum = peaks_data[nblocks - 1];
        if ((peaks_data[0] < bsum) ||
            (rtIsNaN(peaks_data[0]) && (!rtIsNaN(bsum)))) {
          firstBlockLength = nblocks;
        } else {
          bsum = peaks_data[0];
          firstBlockLength = 1;
        }
      }
    } else {
      if (!rtIsNaN(peaks_data[0])) {
        firstBlockLength = 1;
      } else {
        boolean_T exitg1;
        firstBlockLength = 0;
        k = 2;
        exitg1 = false;
        while ((!exitg1) && (k <= nblocks)) {
          if (!rtIsNaN(peaks_data[k - 1])) {
            firstBlockLength = k;
            exitg1 = true;
          } else {
            k++;
          }
        }
      }
      if (firstBlockLength == 0) {
        bsum = peaks_data[0];
        firstBlockLength = 1;
      } else {
        bsum = peaks_data[firstBlockLength - 1];
        i = firstBlockLength + 1;
        for (k = i; k <= nblocks; k++) {
          d = peaks_data[k - 1];
          if (bsum < d) {
            bsum = d;
            firstBlockLength = k;
          }
        }
      }
    }
    flower = peak_locations_data[firstBlockLength - 1];
    /*  绘制水平线 */
    /*  找出交点 */
    find_crossing_points(P, bsum / 1.4142135623730951, cross_freq_data,
                         peak_locations_size);
    /*  找到最近的上下交点，初始化为 -1 表示未找到 */
    bsum = -1.0;
    festimation = -1.0;
    /*  遍历交点数组，找到最近的上下交点 */
    i = peak_locations_size[1];
    for (nblocks = 0; nblocks < i; nblocks++) {
      d = cross_freq_data[nblocks];
      if (d > flower) {
        if ((bsum == -1.0) || (d < bsum)) {
          bsum = d;
        }
      } else if ((d < flower) && ((festimation == -1.0) || (d > festimation))) {
        festimation = d;
      }
    }
    /*  计算阻尼比，如果未找到交点，使用估计值 alpha(4) */
    if ((bsum == -1.0) || (festimation == -1.0)) {
      bsum = alpha_idx_3;
    } else {
      bsum = (bsum - festimation) / (bsum + festimation);
    }
    original_frequency[lastBlockLength] = flower;
    original_dampingratio[lastBlockLength] = bsum;
    if ((lastBlockLength + 1 == 1) &&
        (fabs(festimation1 - flower) / festimation1 > 0.5)) {
      flower = festimation1;
    }
    /*  阻尼比限制条件 */
    if (bsum > 0.2) {
      bsum = alpha_idx_3;
      /*  使用估计值 */
    }
    /*  存储结果 */
    frequency[lastBlockLength] = flower;
    dampingratio[lastBlockLength] = bsum;
  }
}

/* End of code generation (Frequency_dampingratio_estimation_and_plot1219.c) */
